package com.fhz.hilt.viewmodel;

import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;

import com.fhz.hilt.repository.UserRepository;

/**
 * 时间:2023/8/15
 *
 * @author Mr.Feng
 * 简述: TODO
 */
public class LoginViewModelFactory implements ViewModelProvider.Factory {
    private UserRepository mUserRepository;

    public LoginViewModelFactory(UserRepository userRepository) {
        mUserRepository = userRepository;
    }

    @NonNull
    @Override
    public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
        return (T) new LoginViewModel(mUserRepository);
    }
}
